package com.ly.other.biz.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ly.other.dao.OrdersMapper;
import com.ly.other.biz.IOrdersService;
import com.ly.damai.entity.Orders;
import com.ly.other.vo.DacuOrder;
import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author lx
 * @since 2025-03-01
 */
@Service
public class OrdersServiceImpl extends ServiceImpl<OrdersMapper, Orders> implements IOrdersService {

    @RabbitListener(queuesToDeclare = @Queue("dacu.queue"))
    @Override
    public void processDacuOrder(DacuOrder dacuOrder) {
        System.out.println("dacuOrder = " + dacuOrder + " 订单处理完成");
        // TODO 保存订单 + 根据商品id+num 生成 订单明细
    }
}
